</div>
{% load staticfiles %}
<script src="{% static 'js/jquery-3.1.1.min.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
<script type="text/javascript">
    (function () {
        $('.nav__trigger').on('click', function (e) {
            e.preventDefault();
            $('.nav').toggleClass('nav-active-x');
            $('#nav_trigger_parent').toggleClass('nav-trigger-active')
        });
    }())
    function followClick(userId,claPrefix) {
        url = ''
        following = $('#'+claPrefix+userId).hasClass('following')
        if (following) {
            url = '/action/unfollow/'
        } else {
            url = '/action/follow/'
        }
        $.ajax({
            url: url,
            type: 'POST',
            async: true,
            data: {
                'user_id': userId
            },
            success: function (data, status, xhr) {
                if (data) {
                    if (following) {
                        $('#'+claPrefix+userId).text("关注");
                        $('#'+claPrefix+userId).removeClass('following')
                    } else {
                        $('#'+claPrefix+userId).text("取消关注");
                        $('#'+claPrefix+userId).addClass('following')
                    }
                }
            },
            error: function (xhr, status) {
                console.log(status + 'Error');
            }
        })
    }
</script>

<script type="text/javascript">
    if (window !== top) top.location = window.location;
</script>
</body>
</html>